import 'package:chengyu/http/manager.dart';

Future getResouChengyu() async {
  String url = "/chengyu/resou";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future searchChengyuByKey(keyword) async {
  String url = "/chengyu/search?key=$keyword";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}

Future getChengyuDetailInfo(id) async {
  String url = "/chengyu/detail?id=$id";
  try {
    var response = await HttpUtils.request(url, method: HttpUtils.GET);
    return response['data'];
  } catch (e) {
    print(e);
  }
}
